package com.kuaidian.util;

import java.util.Random;

public class RandomUtil {
	
	public static String  getRandomCharsStr(int length){
	  String str="abcdefghijklmnopqrstuvwxyz123456789";  
      Random random = new Random(); 
      StringBuffer sb = new StringBuffer();  
	          
      for(int i = 0 ; i < length; ++i){  
          int number = random.nextInt(str.length());//[0,62)  
          sb.append(str.charAt(number));  
      }  
      return sb.toString(); 
	}
	
	public  static String getRandomNumbersStr(int length){
       String str="123456789";  
       Random random = new Random(); 
       StringBuffer sb = new StringBuffer();  
 	          
       for(int i = 0 ; i < length; ++i){  
           int number = random.nextInt(str.length());
           sb.append(str.charAt(number));  
       }  
       return sb.toString(); 
		
	}
	
	
}
